package com.zdp.domain.dto;


import com.zdp.commons.util.Constants;
import com.zdp.validation.annotation.ValidEmail;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;

@Data
public class UserDto implements Serializable {
    @NotNull
    @NotBlank
    @Size(min = 4, max = 50, message = "用户名长度必须在4到50个字符之间")
    private String username;
    @NotNull
    @NotBlank
    @Size(min = 8, max = 20, message = "密码长度必须在8到20个字符之间")
    private String password;
    @NotNull
    @NotBlank
    @Size(min = 8, max = 20, message = "确认密码长度必须在8到20个字符之间")
    private String matchingPassword;
    @NotNull
    @ValidEmail
    private String email;
    @NotNull
    @NotBlank
    @Size(min = 4, max = 50, message = "姓名长度必须在4到50个字符之间")
    private String name;
    @NotNull
    @Pattern(regexp = Constants.PATTERN_MOBILE)
    private String mobile;
}
